package cn.idempiere.lcn;

import org.compiere.model.MWarehouse;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Language;
import org.compiere.util.Msg;

import com.google.common.base.Strings;

public final class utils {
	/**
	 *	Get fieldName form translated FieldName
	 *  @param  ad_language - Language
	 *  @param	fieldName - translated FieldName
	 *  @return pureFieldName
	 */
	/*
	public static String getFieldName (String tableName, String translatedFieldName)
	{
		return getFieldName(Env.getAD_Language(Env.getCtx()),tableName,translatedFieldName);
	}
	
	public static String getFieldName (String ad_language, String tableName, String translatedFieldName)
	{
		if (Strings.isNullOrEmpty(ad_language))
				return "";
		if (Strings.isNullOrEmpty(tableName))
				return "";
		if (Strings.isNullOrEmpty(translatedFieldName))
				return "";
		
		String SQL = "SELECT name FROM AD_Field WHERE AD_Field = ? AND AD_Client_ID = ? AND name = ?"
		
		String SQL = "SELECT AD_Field_ID FROM AD_Field_Trl WHERE AD_Lanaguage = ? AND AD_Client_ID = ? AND name = ?"

		String sql = "SELECT M_WareHouse_ID FROM M_Warehouse wh "+
				 "WHERE wh.AD_Client_ID = ? AND wh.value = ?"; // AND wh.M_ReserveLocator_ID IS NULL
	
		int warehouseID = DB.getSQLValueEx(get_TrxName(), sql, Env.getAD_Client_ID(getCtx()),defaultName);
		MWarehouse wh = new MWarehouse(this.getCtx(),warehouseID, get_TrxName());
		if ( wh.getM_ReserveLocator_ID() == 0 ) {
			wh.setM_ReserveLocator_ID(wh.getDefaultLocator().get_ID());
			wh.saveEx();
		}
		return true;
		
		return retStr;
	}	//	getMsg
	*/
}
